import { cls, type StyledProps } from '@knno/jsx';
import { titleBarStyle } from './navbar.css';

export type NavBarProps = StyledProps<HTMLDivElement> & {
	title?: string;
	leftButtons?: Node | Node[];
	rightButtons?: Node | Node[];
};

export function NavBar(props: NavBarProps): HTMLDivElement {
	return (
		<div class={cls(props.class, titleBarStyle)} style={props.style}>
			{props.leftButtons}
			<div class="title">{props.title ?? ''}</div>
			{props.rightButtons}
		</div>
	) as HTMLDivElement;
}
